﻿using Abp.Domain.Entities.Auditing;
using JetBrains.Annotations;
using System;
using static Camc.Quality.StoreManagement.StoragePut.StorePutContent;

namespace Camc.Quality.StoreManagement.StoragePut
{
    public class StoreStockContent : FullAuditedEntity<Guid>
    {
        /// <summary>
        /// 库存主表ID
        /// </summary>
        public Guid StoreStockId { get; set; }
        /// <summary>
        /// 合格证入库Id
        /// </summary>
        public Guid? StorePutContentId { get; set; }
        /// <summary>
        /// 物料细料ID
        /// </summary>
        public Guid MaterialsContentId { get; set; }
        /// <summary>
        /// 仓库ID
        /// </summary>
        public Guid StoreId { get; set; }
        /// <summary>
        /// 仓库名称
        /// </summary>
        public string StroeName { get; set; }
        /// <summary>
        /// 储位ID
        /// </summary>
        public string BinLocationId { get; set; }
        /// <summary>
        /// 储位
        /// </summary>
        public string BinLocation { get; set; }
        /// <summary>
        /// 放行单号
        /// </summary>
        public string ReleaseOrder { get; set; }
        /// <summary>
        /// 合格证号
        /// </summary>
        public string QualifiedNumber { get; set; }
        /// <summary>
        /// 产品编号(件号)
        /// </summary>
        public string ProductNumber { get; set; }
        /// <summary>
        /// 产品名称
        /// </summary>
        public string ProductName { get; set; }
        /// <summary>
        /// 型号(产品代号)
        /// </summary>
        public string ProductCode { get; set; }
        /// <summary>
        /// 型号(产品代号)Id
        /// </summary>
        public string ProductCodeId { get; set; }
        /// <summary>
        /// 发次
        /// </summary>
        public string SendTime { get; set; }
        /// <summary>
        /// 发次Id
        /// </summary>
        public string SendTimeId { get; set; }
        /// <summary>
        /// 批次
        /// </summary>
        public string Batch { get; set; }
        /// <summary>
        /// 是否预配套
        /// </summary>
        public IsSuits IsPreSuit { get; set; }
        /// <summary>
        /// 预配套ID
        /// </summary>
        [CanBeNull]
        public Guid? BomAnalysecontentId { get; set; }
        /// <summary>
        /// 是否配套
        /// </summary>
        public IsSuits IsSuit { get; set; }
        /// 配套ID
        /// </summary>
        [CanBeNull]
        public Guid? BomSuitContentId { get; set; }
        /// <summary>
        /// 组合
        /// </summary>
        public string MakeUp { get; set; }
        /// <summary>
        /// 产品图号
        /// </summary>
        public string ProductDrawingNo { get; set; }
        /// <summary>
        /// 产品图号(包含年代)
        /// </summary>
        public string ProductDrawingNoTwo { get; set; }
        /// <summary>
        /// 年代号
        /// </summary>
        public string Years { get; set; } = "";
        /// <summary>
        /// 发次长度
        /// </summary>
        public int SendTimeLength { get; set; }
        /// <summary>
        /// 规格
        /// </summary>
        public string Module { get; set; }
        /// <summary>
        /// 有效期止
        /// </summary> 
        public string ExpirationDate { get; set; }
        /// <summary>
        /// 装入件明细Id
        /// </summary>
        [CanBeNull]
        public Guid? LoadDetailsId { get; set; }
        /// <summary>
        /// 物料属性
        /// </summary>
        public MaterialsPropertys MaterialsProperty { get; set; }
        /// <summary>
        /// 库存状态
        /// </summary> 
        [CanBeNull]
        public OutboundStates OutboundState { get; set; } = OutboundStates.在库;
        ///// <summary>
        ///// 出库单据Id
        ///// </summary>
        //public Guid? RetrievalId { get; set; }

        /// <summary>
        /// 出库状态
        /// </summary>
        [CanBeNull]
        public OutboundRetrieval? RetrievalState { get; set; }

        public enum IsSuits
        {
            否 = 0,
            是 = 1
        }
        public enum OutboundStates
        { 
            在库,
            未领料,
            出库,
        }
        /// <summary>
        /// 数量
        /// </summary>
        public int Quantity { get; set; } = 1;
        /// <summary>
        /// 预配套人
        /// </summary>
        public string PreSuiteName { get; set; }
        /// <summary>
        /// 预配套时间
        /// </summary>
        /// [CanBeNull]
        public DateTime? PreSuiteTime { get; set; }
        /// <summary>
        /// 配套人
        /// </summary>
        public string CompletePeople { get; set; }
        /// <summary>
        /// 配套时间
        /// </summary>
        [CanBeNull]
        public DateTime? CompleteTime { get; set; }
        /// <summary>
        /// 指定型号
        /// </summary>
        public string DesignatedModule { get; set; }
        /// <summary>
        /// 指定发次
        /// </summary>
        public string DesignatedSendTime { get; set; }
        /// <summary>
        /// 指定芯级名称
        /// </summary>
        public string DesignatedXJ { get; set; }
        /// <summary>
        /// 指定芯级图号
        /// </summary>
        public string DesignatedXJCode { get; set; }
        /// <summary>
        /// 所属工步id
        /// </summary>
        public Guid? WorkStepId { get; set; }

        /// <summary>
        /// 出库单号
        /// </summary>
        public Guid? DeliveryDocumentId { get; set; }
    }
}
